package titt.head.response;

import titt.TITTValues;
import titt.head.HTTPHead;
import titt.head.HeadFactory;
import titt.head.util.AbstractHead;

public class ResponseHead extends AbstractHead implements HTTPHead {

	private int status;
	
	public ResponseHead(HTTPHead h) {
		this(Integer.parseInt(h.getStatusLine().split(" ")[1]), h);
	}
	
	public ResponseHead(int status, HTTPHead h) {
		super.h = HeadFactory.createHead(h, TITTValues.getResponse(status));
		this.status = status;
	}

	public int getStatusCode() {
		return status;
	}
	
	public String getContentType() {
		return h.getHeader("Content-Type").getValue();
	}
}
